{% extends "main/base.html" %}
{% load i18n %}
{% block title %}{% trans '添加客户' %}{% endblock %}
{% block content %}
<div class="panel">
    <header class="panel-heading">
        {% trans "添加客户" %}
        {% if form.errors %}
        <p>{% trans "提交的数据有误,请认真检查!" %}</p>
        {% endif %}
    </header>
    <div class="panel-body">
        <form method="post" action="{% url 'main:client_create' %}?next={{ request.path }}" class="form-horizontal">{% csrf_token %}
            {{ form.non_field_errors }}
            {% if request.user.is_authenticated %}
            <input type="hidden" name="created_by" id="id_created_by" value="{{ request.user.id }}">
            {% endif %}
            <div class="form-group col-md-4">
                <div class="col-sm-3">{{ form.name.label_tag }}</div>
                <div class="col-sm-9">{{ form.name }}{{ form.name.errors }}</div>
            </div>
            <div class="form-group col-md-4">
                <div class="col-sm-3">{{ form.gender.label_tag }}</div>
                <div class="col-sm-9">{{ form.gender }}{{ form.gender.errors }}</div>
            </div>
            <div class="form-group col-md-4">
                <div class="col-sm-3">{{ form.mobile.label_tag }}</div>
                <div class="col-sm-9">{{ form.mobile }}{{ form.mobile.errors }}</div>
            </div>
            <div class="form-group col-md-4">
                <div class="col-sm-3">{{ form.fax.label_tag }}</div>
                <div class="col-sm-9">{{ form.fax }}{{ form.fax.errors }}</div>
            </div>
            <div class="form-group col-md-4">
                <div class="col-sm-3">{{ form.wechat.label_tag }}</div>
                <div class="col-sm-9">{{ form.wechat }}{{ form.wechat.errors }}</div>
            </div>
            <div class="form-group col-md-4">
                <div class="col-sm-3">{{ form.email.label_tag }}</div>
                <div class="col-sm-9">{{ form.email }}{{ form.email.errors }}</div>
            </div>
            <div class="form-group col-md-4">
                <div class="col-sm-3">{{ form.tax_code.label_tag }}</div>
                <div class="col-sm-9">{{ form.tax_code }}{{ form.tax_code.errors }}</div>
            </div>
            <div class="form-group col-md-4">
                <div class="col-sm-3">{{ form.bank.label_tag }}</div>
                <div class="col-sm-9">{{ form.bank }}{{ form.bank.errors }}</div>
            </div>
            <div class="form-group col-md-4">
                <div class="col-sm-4">{{ form.bank_account.label_tag }}</div>
                <div class="col-sm-8">{{ form.bank_account }}{{ form.bank_account.errors }}</div>
            </div>
            <div class="form-group col-md-9">
                <div class="col-sm-2">{{ form.company.label_tag }}</div>
                <div class="col-sm-10">{{ form.company }}{{ form.company.errors }}</div>
            </div>
            <div class="form-group col-md-9">
                <div class="col-sm-2">{{ form.company_address.label_tag }}</div>
                <div class="col-sm-10">{{ form.company_address }}{{ form.company_address.errors }}</div>
            </div>
            <div class="form-group col-md-9">
                <div class="col-sm-2">{{ form.post_address.label_tag }}</div>
                <div class="col-sm-10">{{ form.post_address }}{{ form.post_address.errors }}</div>
            </div>
            <div class="form-group col-md-9">
                <div class="col-sm-2">{{ form.desc.label_tag }}</div>
                <div class="col-sm-10">{{ form.desc }}{{ form.desc.errors }}</div>
            </div>
            <div class="form-group col-md-12" align="right">
                <button type="submit" class="btn btn-primary">{% trans "添加" %}</button>
            </div>
        </form>
    </div>
</div>
{% endblock %}